package edu.sctu.zhengsenwen.month201505.day20150524;

import java.util.ArrayList;
import java.util.List;
/**
 * Created by user15 on 2015/5/24.
 */
public class TextMore {


      public List<Teacher> sortNumber(){
          TeacherInformation teacherInformation = new TeacherInformation();
          List<Teacher> list = teacherInformation.getTeacher();


          for(int i = 0;i<list.size()-1;i++){
              for(int j=0;j<list.size()-1;j++){
                  if(list.get(j).getNumber()>list.get(i+1).getNumber()){
                      list.add(j,list.get(j+1));
                      list.remove(j+2);
                  }
              }
          }
          return list;
      }



    public List<Student> sortStudnt(){
        TeacherInformation teacherInformation1 = new TeacherInformation();
        List<Teacher> list = teacherInformation1.getTeacher();

        List<Student> list1 = new ArrayList<>();

        for(int i= 0;i<list.size();i++){
            for(int j= 0;j<list.get(i).getStudent().size();j++){
                list1.add((list.get(i).getStudent().get(j)));

            }
        }
        return list1;
    }


    public List<Teacher> pritCoded(){
        TeacherInformation teacherInformation2 = new TeacherInformation();

        List<Teacher> list = teacherInformation2.getTeacher();
        List<Teacher> list1 = new ArrayList<>();


        for(int i=0;i<list.size();i++){
            if(list.get(i).getPostion().equals("教授")){
                list1.add(list.get(i));
            }
        }
        return list1;
    }


}
